function Shape(id){
    this.id = id;
}
Shape.prototype.name = 'shape';
Shape.prototype.toString = function(){
    return this.name;
}
function Triangle(){
    Shape.apply(this.arguments)
}



var t =  new Triangle(101);
console.log("var t =  new Triangle(101)");
console.log("t.name");
console.log(t.name);
console.log('t.id');
console.log(t.id);
console.log("t.toString()");
console.log(t.toString());

function Triangle(){
    Shape.apply(this,arguments);
}
Triangle.prototype = new Shape();
Triangle.prototype.name = 'Triangle';
var t =  new Triangle(101);
console.log("var t =  new Triangle(101)");
console.log("t.name");
console.log(t.name);
console.log('t.id');
console.log(t.id);
console.log("t.toString()");
console.log(t.toString());